package com.lijie.ljblog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lijie.ljblog.mapper.ClassifyMapper;
import com.lijie.ljblog.mapper.DiaryMapper;
import com.lijie.ljblog.model.Classify;
import com.lijie.ljblog.model.Diary;
import com.lijie.ljblog.service.ClassifyService;
import com.lijie.ljblog.service.DiaryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title: ljblog_springboot
 * @Description: ()
 * @Author:lijie
 * @Version:1.1.0
 * @since 2021/11/10
 */
@Service
public class DiaryServiceImpl extends ServiceImpl<DiaryMapper, Diary> implements DiaryService {
    @Override
    public PageInfo<Diary> listDiary(Integer page) {
        PageHelper.startPage(page,20);
        QueryWrapper<Diary> queryWrapper=new QueryWrapper<>();
        queryWrapper.orderByDesc("time");
        List<Diary> list = this.list(queryWrapper);
        return new PageInfo<>(list);
    }

}
